#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int num1, num2, flag = 0, sum = 0;
    cin >> num1 >> num2;
    for (int i = num1;i <= num2;i++)
    {
        ++flag;
        sum += i;
        printf("%5d", i);
        if (flag == 5 && num2 - num1 != 4)
        {
            flag = 0;
            cout << endl;
        }
    }
    printf("\nSum = %d", sum);
    return 0;
}
